﻿@model IEnumerable<OrderHistoryItem>
@using BankCreditPortfolio.Core.Helpers
@using BankCreditPortfolio.DAL.Entities
@using MvcContrib.Pagination
@using MvcContrib.UI.Grid
@using MvcContrib.UI.Pager

@{
    ViewBag.Title = "Order History";
}
<strong>Order History</strong>
<p>
	Here you can see order history.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Styles/forms.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Styles/customgrid.css")" rel="stylesheet" type="text/css" />

@using (Html.BeginForm())
{
    <div>
@{
    if (Model.Count() != 0)
    {
        var grid = Html.Grid(Model).Columns(column =>
        {
            column.For(x => x.BankerName).Named("Banker");
            column.For(x => x.BamkerRole).Named("Banker Role");
            column.For(x => x.Status).Named("Order Status");
            column.For(x => x.ActionDate.Value.ToShortDateString() ?? String.Empty).Named("Reviewed Date");
            column.For(x => x.Comment).Named("Comment");
        });
        grid.Render();
        <br />
    }
    else
    {
		<div>There is no order history.</div>
    }
}
    </div> 
}